package com.xyazm.customer.remote;

import com.xyazm.common.core.JsonResult;
import com.xyazm.common.utils.CheckResultUtil;
import com.xyazm.order.api.IOrderAfterSaleApi;
import com.xyazm.order.domain.param.ReceiveCustomerAfterSaleParam;
import com.xyazm.order.domain.param.ReceiveCustomerAuditResultParam;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

/**
 * 订单售后远程接口
 * @author xuyou
 * 2022-12-12 22:34
*/
@Component
public class OrderAfterSaleRemote {

    @DubboReference(version = "1.0.0")
    private IOrderAfterSaleApi orderAfterSaleApi;

    /**
     * 客服系统查询售后支付单信息
     * @return
     */
    public Long customerFindAfterSaleRefundInfo(ReceiveCustomerAfterSaleParam receiveCustomerAuditResultParam) {
        JsonResult<Long> jsonResult = orderAfterSaleApi.customerFindAfterSaleRefundInfo(receiveCustomerAuditResultParam);
        CheckResultUtil.checkResult(jsonResult,"客服系统查询售后支付单信息");
        return jsonResult.getData();
    }


    /**
     * 接收客服的审核结果
     */
    public void receiveCustomerAuditResult(ReceiveCustomerAuditResultParam receiveCustomerAuditResultParam) {
        JsonResult<Boolean> jsonResult = orderAfterSaleApi.receiveCustomerAuditResult(receiveCustomerAuditResultParam);
        CheckResultUtil.checkResult(jsonResult,"客服审核售后申请结果回传");
    }

}
